#pragma once

template<class T>
class Unique_ptr
{
public:
	Unique_ptr(T* ptr=nullptr)
		:_ptr(ptr)
	{

	}

	~Unique_ptr()
	{
		if (ptr) delete(_ptr);
	}

	T& operator*()
	{
		return *_ptr;
	}

	T* operator->()
	{
		return _ptr;
	}

private:
	Unique_ptr(Unique_ptr<T> const& ) = delete;
	Unique_ptr& operator=(Unique_ptr<T> const&) = delete;

private:
	T* _ptr;
};
